package com.cdut.hwadeefsc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.Date;

/**
 * 学生奖罚表
 * @TableName awards
 */
@TableName(value ="awards")
public class awards {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 学生ID (关联 users.id)
     */
    private Long studentId;

    /**
     * 学工系统中的学号
     */
    private String externalStudentNo;

    /**
     * 奖罚具体描述
     */
    private String description;

    /**
     * 类型 (1=奖励, 2=处罚)
     */
    private Integer type;

    /**
     * 发布老师ID (关联 users.id)
     */
    private Long issuedBy;

    /**
     * 发布日期
     */
    private LocalDate issuedAt;

    /**
     * 创建时间
     */
    private LocalDate createdAt;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public Long getStudentId() {
        return studentId;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    /**
     * 学工系统中的学号
     */
    public String getExternalStudentNo() {
        return externalStudentNo;
    }

    /**
     * 学工系统中的学号
     */
    public void setExternalStudentNo(String externalStudentNo) {
        this.externalStudentNo = externalStudentNo;
    }

    /**
     * 奖罚具体描述
     */
    public String getDescription() {
        return description;
    }

    /**
     * 奖罚具体描述
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * 类型 (1=奖励, 2=处罚)
     */
    public Integer getType() {
        return type;
    }

    /**
     * 类型 (1=奖励, 2=处罚)
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 发布老师ID (关联 users.id)
     */
    public Long getIssuedBy() {
        return issuedBy;
    }

    /**
     * 发布老师ID (关联 users.id)
     */
    public void setIssuedBy(Long issuedBy) {
        this.issuedBy = issuedBy;
    }

    /**
     * 发布日期
     */
    public LocalDate getIssuedAt() {
        return issuedAt;
    }

    /**
     * 发布日期
     */
    public void setIssuedAt(LocalDate issuedAt) {
        this.issuedAt = issuedAt;
    }

    /**
     * 创建时间
     */
    public LocalDate getCreatedAt() {
        return createdAt;
    }

    /**
     * 创建时间
     */
    public void setCreatedAt(LocalDate createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        awards other = (awards) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getExternalStudentNo() == null ? other.getExternalStudentNo() == null : this.getExternalStudentNo().equals(other.getExternalStudentNo()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getIssuedBy() == null ? other.getIssuedBy() == null : this.getIssuedBy().equals(other.getIssuedBy()))
            && (this.getIssuedAt() == null ? other.getIssuedAt() == null : this.getIssuedAt().equals(other.getIssuedAt()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getExternalStudentNo() == null) ? 0 : getExternalStudentNo().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getIssuedBy() == null) ? 0 : getIssuedBy().hashCode());
        result = prime * result + ((getIssuedAt() == null) ? 0 : getIssuedAt().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", studentId=").append(studentId);
        sb.append(", externalStudentNo=").append(externalStudentNo);
        sb.append(", description=").append(description);
        sb.append(", type=").append(type);
        sb.append(", issuedBy=").append(issuedBy);
        sb.append(", issuedAt=").append(issuedAt);
        sb.append(", createdAt=").append(createdAt);
        sb.append("]");
        return sb.toString();
    }
}